<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="css/style.css">
    <link rel="stylesheet" href="bootstrap/css/bootstrap.css">
    <script src="jquery/jquery-3.4.1.min.js"></script>
    <style>
        .red{
            color: #ff0000;
        }
    </style>


</head>
<body style="background: url('images/newlogin.jpg') no-repeat;background-size: 100% 80%">
<!-- 头部导航header start -->
<!--<header>-->
<!--    <nav class="navbar navbar-default navbar-inverse">-->
<!--        <div class="container">-->
<!--            <div class="navbar-header">-->
<!--                <a href="#" class="nav-brand">-->
<!--                    <img src="images/logo1.png" width="220" height="60">-->
<!--                </a>-->
<!--            </div>-->
<!--        </div>-->
<!--    </nav>-->
<!--</header>-->

<section>
    <div class="contacts" >
        <div class="container">
            <div class="row">
                <div class="col-md-3"></div>
                <div class="col-md-6 " style="margin-top:50px;margin-bottom:50px;background-color: rgba(0,0,0,0.2);border: none">
                    <div class="new-title">
                        <div class="row" style="padding-top: 50px">
                            <div class="text-center col-xs-6  col-xs-offset-3"><h2>Sign in</h2></div>
                        </div>

                            <div class="row contacts-inpt" >
                                <div class="row" style="padding-top: 50px">
                                    <div class="col-xs-6 col-xs-offset-3"><input type="text" class="form-control" id="u_name"  placeholder="用户名/username"></div>
                                </div>
                            </div>
                            <div class="row contacts-inpt">
                                <div class="row" style="padding-top: 30px;">
                                    <div class="col-md-6 col-xs-offset-3"><input type="password" class="form-control" id="u_pwd" placeholder="登录密码/login password"></div>
                                </div>
                            </div>
                            <div class="row" style="padding-top: 10px;">
                                <div class="col-md-3 col-md-offset-3">
                                    <div class="checkbox">
                                        <label><input type="checkbox"> 请记住我</label>
                                    </div>
                                </div>
                                <div class="col-md-7">
                                    <label class="red hidden" id="errorLog">登录错误</label>
                                </div>
                            </div>


                        <div class="panel-info text-center" style="padding-top: 20px;">
                            <button  class="btn btn-info btn-primary-outline col-md-6 col-md-offset-3" id="loginbtn">确定</button>
                        </div>
                        <div class="row panel-info col-md-offset-3" style=" padding-bottom: 30px">
                            <button  class="btn btn-link pull-right" id="gotoRegister">立即注册</button>
                        </div>
                    </div>
                </div>
                <div class="col-md-3"></div>
            </div>
        </div>
    </div>
</section>
<!-- footer 部分 start -->
<footer>
    <div class="nav-list">
        <div class="container-fluid">
            <div class="row">
                <div class="col-md-2 col-xs-1">
                    <h4>关于公司</h4>
                    <ul>
                        <li><a href="#">企业简介</a></li>
                        <li><a href="#">品牌简介</a></li>
                        <li><a href="#">品牌荣盛</a></li>
                        <li><a href="#">品牌文化</a></li>
                    </ul>
                </div>
                <div class="col-md-2 col-xs-1">
                    <h4>订单服务</h4>
                    <ul>
                        <li><a href="#">购买指南</a></li>
                        <li><a href="#">支付方式</a></li>
                        <li><a href="#">合作物流</a></li>
                        <li><a href="#">发货时间</a></li>
                    </ul>
                </div>
                <div class="col-md-2 col-xs-1">
                    <h4>服务支持</h4>
                    <ul>
                        <li><a href="#">售后服务</a></li>
                        <li><a href="#">申请退换</a></li>
                        <li><a href="#">上门服务</a></li>
                        <li><a href="#">授权商家</a></li>
                    </ul>
                </div>
                <div class="col-md-2 col-xs-1">
                    <h4>关于我们</h4>
                    <ul>
                        <li><a href="#">人才理念</a></li>
                        <li><a href="#">经营理念</a></li>
                        <li><a href="#">联系方式</a></li>
                        <li><a href="#">集团战略</a></li>
                    </ul>
                </div>
                <div class="col-md-2 col-xs-1">
                    <h4>新闻中心</h4>
                    <ul>
                        <li><a href="#">研发中心</a></li>
                        <li><a href="#">行业新闻</a></li>
                        <li><a href="#">最新资讯</a></li>
                        <li><a href="#">国际时报</a></li>
                    </ul>
                </div>
                <div class="col-md-2 col-xs-2">
                    <div class="abtn workdate">
                        <a href="#" class="text-center">联系客服</a>
                    </div>
                    <h3>952 952-9527</h3>
                    <p >周一至周日9:00-18:00(节假日除外)</p>
                </div>
            </div>
        </div>
    </div>
    <div class="copryright">
        <div class="container-fluid">
            <div class="row">
                <div class="col-md-8 col-xs-4 col-md-offset-2 col-xs-offset-4">
                    <span class="copry">Copryright 2020 软件人-卓越第九小组 all right Reserved 卓越第九小组工作室 </span>
                    <a href="#">| 法律声明 | 隐私条款</a>
                    <p class="copry">粤备xxxxxxx号  公安备xxxxxx号</p>
                </div>
            </div>
        </div>
    </div>
</footer>
<!-- footer 部分 end -->

</body>
<script>
    $(document).ready(function () {
        $("#gotoRegister").click(function (){
            $(location).attr("href","gotoRegister");
        });
        $("#loginbtn").click(function () {
            $.ajax({
                url:"user/login",
                type:"post",
                dataType:"json",
                data:{
                    u_name:$("#u_name").val(),
                    u_pwd:$("#u_pwd").val()
                },
                //result封装成立json对象，解析result.
                success:function (result) {
                    var errorCode = result.errorCode;
                    if(errorCode!=-1){
                        if(errorCode==1){
                            $(location).attr("href","gotoSadminIndex");
                        }else if(errorCode==2){
                            $(location).attr("href","gotoGadminIndex");
                        } else if(errorCode==3){
                            $(location).attr("href","gotoyhIndex");
                        }
                    }else{
                        var msg = result.status;
                        $("#u_pwd").val("");
                        $("#errorLog").text(msg);
                        $("#errorLog").removeClass("hidden");
                    }
                },
                error:function (result) {
                }
            })
        });

    })

</script>
</html>